package com.hnkywl.sts.entity.organ;

import com.hnkywl.sts.entity.base.Sjzdz;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.List;

/**
 * 说明：内部公司
 * 包:        com.hnkywl.sts.entity.organ
 * 类描述:    内部公司
 * 修改备注: [说明本次修改内容]
 * 版本:        [v1.0]
 */
@Entity
@DiscriminatorValue("nbgs")
public class Nbgs extends Gsjg {
    /**
     * 财务软件
     */
    @ManyToOne
    @JoinColumn(name = "SJZDZ_CWRJ_ID")
    private Sjzdz cwrj;

    /**
     * 税控软件
     */
    @ManyToOne
    @JoinColumn(name = "SJZDZ_SKRJ_ID")
    private Sjzdz skrj;

    /**
     * 增票行数
     */
    private Integer zphs;

    /**
     * 增票面额
     */
    private Float zpme;

    /**
     * 办公地址
     */
    private String bgdz;

//    /**
//     * 企业法人
//     */
//    @ManyToOne(fetch = FetchType.LAZY)
//    @JoinColumn(name = "QYFR_ID")
//    private Qyfr qyfr;

    /**
     * 开户行
     */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "nbgs", targetEntity = Khh.class)
    @NotFound(action = NotFoundAction.EXCEPTION)
    @Where(clause = "deleted!='1'")
    private List<Khh> khhList;

    public Sjzdz getCwrj() {
        return cwrj;
    }

    public void setCwrj(Sjzdz cwrj) {
        this.cwrj = cwrj;
    }

    public Sjzdz getSkrj() {
        return skrj;
    }

    public void setSkrj(Sjzdz skrj) {
        this.skrj = skrj;
    }

    public Integer getZphs() {
        return zphs;
    }

    public void setZphs(Integer zphs) {
        this.zphs = zphs;
    }

    public Float getZpme() {
        return zpme;
    }

    public void setZpme(Float zpme) {
        this.zpme = zpme;
    }

    public String getBgdz() {
        return bgdz;
    }

    public void setBgdz(String bgdz) {
        this.bgdz = bgdz;
    }

    public List<Khh> getKhhList() {
        return khhList;
    }

    public void setKhhList(List<Khh> khhList) {
        this.khhList = khhList;
    }

    public String className() {
        return "Nbgs";
    }
}
